package com.nbsaas.boot.room.rest.convert;

import com.nbsaas.boot.room.data.entity.Room;
import com.nbsaas.boot.room.api.domain.simple.RoomSimple;

import com.nbsaas.boot.rest.api.Converter;

/**
* 列表对象转换器
*/

public class RoomSimpleConvert implements Converter<RoomSimple, Room> {




@Override
public RoomSimple convert(Room source) {
    RoomSimple result = new RoomSimple();

                result.setNote(source.getNote());
                if(source.getShop()!=null){
                    result.setShop(source.getShop().getId());
                }
                result.setAddress(source.getAddress());
                result.setLng(source.getLng());
                result.setIcon(source.getIcon());
                if(source.getShop()!=null){
                    result.setShopName(source.getShop().getName());
                }
                result.setAddDate(source.getAddDate());
                result.setPhone(source.getPhone());
                result.setName(source.getName());
                result.setLogo(source.getLogo());
                result.setId(source.getId());
                result.setLat(source.getLat());
                result.setLastDate(source.getLastDate());


    return result;
}

}